﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using SlamDunk.MES.Domain.Entities.ConfigurationContext;

namespace SlamDunk.MES.Repository.EntityConfigurations.ConfigurationContext
{
    /// <summary>
    /// 硬件连接实体映射配置
    /// </summary>
    public class HardwareConnectionConfig : IEntityTypeConfiguration<HardwareConnection>
    {
        /// <summary>
        /// 配置
        /// </summary>
        public void Configure(EntityTypeBuilder<HardwareConnection> builder)
        {
            //配置属性
            builder.HasKey(entity => entity.Id).IsClustered(false);

            //配置索引
            builder.HasIndex(entity => entity.AddedTime).IsUnique(false).IsClustered();
        }
    }
}
